const { contextBridge, ipcRenderer } = require('electron');

// 接口暴露给渲染进程
contextBridge.exposeInMainWorld('electronAPI', {
  // startSLAM: (params) => ipcRenderer.invoke('start-slam', params),
  startSLAM: (params) => ipcRenderer.invoke('start-slam', params),
  stopSLAM: () => ipcRenderer.invoke('stop-slam'),
  openFileDialog: () => ipcRenderer.invoke('open-file-dialog'),
  openFilesDialog: () => ipcRenderer.invoke('open-files-dialog'),
  getUserInfo: () => ipcRenderer.invoke('get-user-info'),
  getTrajInfo: () => ipcRenderer.invoke('get-traj-info'),
  readTrajFile: (path) => ipcRenderer.invoke('read-traj-file', path),
  deleteTrajFile: (name, gTime) => ipcRenderer.invoke('delete-traj-file', name, gTime),
  login: (name, password) => ipcRenderer.invoke('login', name, password),
  openTrajWindow: (filePath) => ipcRenderer.invoke('open-traj-window', filePath),
  compareTraj: (filePath, trajSetForm) => ipcRenderer.invoke('compare-traj', filePath, trajSetForm)
});
